package guoan.repository;

import java.util.List;

import guoan.domain.Coach;

import org.joda.time.DateTime;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface CoachRepository extends PagingAndSortingRepository<Coach, Long>, JpaSpecificationExecutor<Coach> {

	Coach findByCoachTimeAndTrainIdAndType(DateTime tempDateTime, Long id, Long type);

    List<Coach> findByTypeAndTrainIdAndCoachTimeBetween(Long type,
            Long trainId, DateTime dateTime, DateTime toDate);

	List<Coach> findByIdGreaterThanAndTrainIdAndType(Long id, Long id2, Long type);

}
